//
// Created by Semir on 2020/4/24.
//

#include <iostream>

using namespace std;

int n, k;

int count(int origin, int target, int parts) {
    if (origin * parts > target) {
        cout << "Error" << endl;
        return -1;
    }
    int sum = 0;
    if (parts > 2) {
        for (int i = origin; ; i++) {
            if (i * (parts - 1) > target - i) {
                break;
            }
            sum += count(i, target - i, parts - 1);
        }
    } else {
        for (int i = origin; i <= target / 2; i++) {
            sum++;
        }
    }
    return sum;
}

int main() {
    cin >> n >> k;
    int result = 0;
    if (k > 2) {
        for (int i = 1; ; i++) {
            if (i * (k - 1) > n - i) {
                break;
            }
            result += count(i, n - i, k - 1);
        }
    } else {
        result = n / 2;
    }
    cout << result << endl;
    return 0;
}